﻿using System;
using System.Drawing;

namespace SantaSLittleIrcHelper
{

    public delegate void StepCallback(String line);
    public delegate void SetFeedbackTranslationTagCallback(Color col, String text, String[] paramX);


    abstract class Process
    {
        public String triggerString { get; protected set; }
        public StepCallback step { get; protected set; }
        public TLabel feedbackLabel { get; protected set; }

        public abstract void start();

        public void invokeSetFeedbackMessage(Color col, String text)
        {
            this.invokedSetFeedbackMessage(col, text, null);
        }

        public void invokeSetFeedbackMessage(Color col, String text, params String[] args)
        {
            SetFeedbackTranslationTagCallback foo = new SetFeedbackTranslationTagCallback(invokedSetFeedbackMessage);
            Program.instance.GUI.Invoke(foo, new object[] {col, text, args});
        }

        public void invokedSetFeedbackMessage(Color col, String text, String[] args)
        {
            this.feedbackLabel.Key = text;
            this.feedbackLabel.ForeColor = col;
            this.feedbackLabel.Args = args;
        }


    }
}
